﻿using RM.DesktopApp.IModelViews;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RM.DesktopApp.Views
{
    public partial class RoomManagementView : Form, IRoomManagementView
    {
        RoomManagementController controller;

        public RoomManagementView()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        #region controller methods

        public void SetController(RoomManagementController controller)
        {
            this.controller = controller;
        }

        public void ClearList()
        {
            lstRooms.Columns.Clear();
            lstRooms.Columns.Add("Id", 50, HorizontalAlignment.Left);
            lstRooms.Columns.Add("Ten phong", 150, HorizontalAlignment.Left);
            lstRooms.Columns.Add("Loai phong", 150, HorizontalAlignment.Left);
            lstRooms.Columns.Add("Ngay tao", 150, HorizontalAlignment.Left);
            lstRooms.Columns.Add("Chi tiet", 100, HorizontalAlignment.Left);
            lstRooms.Items.Clear();
        }

        public void AddRoomToList(Model.Rooms.Room room)
        {
            ListViewItem parent;
            //parent = lstRooms.Items.Add(room.Key + "");
            //parent.SubItems.Add(room.Name);
            //parent.SubItems.Add(room.Type.Name);
            //parent.SubItems.Add(room.DateCreate.ToShortDateString());
        }

        public void RemoveRoomFromList(Model.Rooms.Room room)
        {
            // throw new NotImplementedException();
        }

        public void SetSelectedRoomInList(Model.Rooms.Room room)
        {
            // throw new NotImplementedException();
        }

        #endregion

    }
}
